﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using CK.Sprite.Form.Test.Models;
using CK.Sprite.Form.Core;
using Newtonsoft.Json.Linq;

namespace CK.Sprite.Form.Test.Controllers
{
    [ApiController]
    [Area("spriteform")]
    [ControllerName("Runtime")]
    [Route("api/spriteform/common")]
    public class RuntimeController : Controller, IRuntimeAppService
    {
        private readonly IRuntimeAppService _commonAppService;

        public RuntimeController(IRuntimeAppService commonAppService)
        {
            _commonAppService = commonAppService;
        }

        [HttpPost]
        [Route("DoRuntimeMethod")]
        public async Task<JArray> DoRuntimeMethod(JObject paramObject)
        {
            return await _commonAppService.DoRuntimeMethod(paramObject);
        }
    }
}
